﻿CREATE TABLE [dbo].[OrdenesComprasArticulos] (
    [IdOrdenCompraArticulo] INT             IDENTITY (1, 1) NOT NULL,
    [IdOrdenCompra]         INT             NOT NULL,
    [IdArticulo]            INT             NOT NULL,
    [Cantidad]              INT             NOT NULL,
    [Precio]                DECIMAL (19, 4) NOT NULL,
    [Iva]                   DECIMAL (19, 4) NOT NULL,
    [DescuentoRecargo]      DECIMAL (19, 4) NOT NULL,
    CONSTRAINT [PK_OrdenesComprasArticulos] PRIMARY KEY CLUSTERED ([IdOrdenCompraArticulo] ASC),
    CONSTRAINT [FK_OrdenesComprasArticulos_Articulos] FOREIGN KEY ([IdArticulo]) REFERENCES [dbo].[Articulos] ([IdArticulo]),
    CONSTRAINT [FK_OrdenesComprasArticulos_OrdenesCompras] FOREIGN KEY ([IdOrdenCompra]) REFERENCES [dbo].[OrdenesCompras] ([IdOrdenCompra])
);

